public class arrayWork {
    static public int random(int start, int end) {
       return (int)(Math.random() * (end - start) + start);
    }
    static public int[] rand(int [] arr, int start, int end) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random(start, end);
        }
        return arr;
    } 

    static public int[] rand(int len, int start, int end) {
        // int arr[] = new int[len];
        return rand(new int[len], start, end);
    }
    static public String show(int [] arr, boolean ... flags) {
        String out = "";
        for(int i = 0; i < arr.length; i++) {
            out += arr[i];
            if (i == arr.length - 1) {
                out += "\n";
            } else {
                out += " ";
            }
        }
        if (!(flags.length > 0 && flags[0] == true)) {
            System.out.printf("%s", out);
        }
        return out;
    }
    static public void main(String [] args) {
        int [] arr = rand(10, 20, 100);
        show(arr);
        System.out.printf("%s", show(arr, true));
    }
}
